package com.xhsj.user.sms.purchase.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xhsj.user.sms.purchase.entity.TbPurchaseSubtaskQualityRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 采购订单-质检记录表 Mapper 接口
 * </p>
 *
 * @author suxiaolin
 * @since 2020-04-30
 */
@Mapper
public interface TbPurchaseSubtaskQualityRecordMapper extends BaseMapper<TbPurchaseSubtaskQualityRecord> {

    //质检记录相关的数据
    List<Map<String, Object>> getOrderQualityRecordList(@Param("dataId") String dataId);

    //获取质检最新记录良品，特采，退货数量
    List<Map<String, Object>> getOrderQualityRecordNumList(@Param("dataId") String dataId, @Param("type") int type);

    //获取待入库数量
    List<Map<String, Object>> getWarehousingNumberList(@Param("dataId") String dataId);

    //获取质检最大批次
    String getMaxBatch(@Param("dataId") String dataId);

    //数据库中的待入库量
    int getWaitStorageNumber(@Param("dataId") String dataId, @Param("purchaseSubtaskListId") String purchaseSubtaskListId);

    int updateStorageStatus(@Param("storageStatus") int storageStatus, @Param("recordBatch") Integer recordBatch, @Param("dataId") String dataId);

    //获取入库时质检记录
    List<Map<String, Object>> getWarehousingQualityRecordList(@Param("dataId") String dataId);
}
